package com.example.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

/**
 *
 * @author changwei
 * @date 2019年11月18日
 */
public class RequestUtil {

	public static HttpServletRequest getRequest() {
		ServletRequestAttributes ra = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
		return ra.getRequest();
	}
	
	public static HttpSession getSession() {
		return getRequest().getSession();
	}
}
